<!DOCTYPE html>
<html lang="en" th:fragment="usercontent">
<head>
</head>
<body>
<div class="col-lg-9 col-md-9 mt" id="standard">
    <!--<div class="btn-group btn-xs mb pull-right" style="margin-top: -25px;" th:if="${collects.size() > 0}"> <a class="btn btn-xs btn-default active" > <span class="icon-layers"></span> </a> <a class="btn btn-xs btn-default" id="standardBtn"> <span class="icon-list"></span> </a> </div>-->
    <ul class="timeline-alt" id="collectStandardList">
        <li th:each="collect,collectStat : ${collects}" > <a href="javascript:void(0);" class="hidden-xs timeline-badge sharing-user-avatar" th:style="'background-image:url(/' + @{(${user.profilePicture==null?'img/favicon.png':user.profilePicture})} + ')'" ></a>
            <div class="timeline-panel">
                <div class="popover right">
                    <div class="arrow"></div>
                    <div class="popover-content">
                        <div class="table-grid">
                            <div class="col">
                                <div class="pull-right dropdown dropdown-list" th:if="${myself=='YES'}"> <a href="#" data-toggle="dropdown" class="sharing-more-button" > <span class="fa fa-angle-down"></span> </a>
                                    <ul class="dropdown-menu animated bounceIn">
                                        <li>
                                            <div class="list-group"> <a href="javascript:void(0);" th:onclick="'getCollect(' + ${collect.id} + ',\'usercontent\');'" class="list-group-item">
                                                <div class="media-box">
                                                    <div class="pull-left"> <em class="fa fa-pencil-square-o fa-2x fa-fw text-info"></em> </div>
                                                    <div class="media-box-body clearfix">
                                                        <p class="m0">修改收藏</p>
                                                        <p class="m0 text-muted"> <small>修改收藏的各种属性</small> </p>
                                                    </div>
                                                </div>
                                                </a> <a href="javascript:void(0);" class="list-group-item" th:onclick="'onCollect(' + ${collect.id} + ',\'usercontent\');'">
                                                <div class="media-box">
                                                    <div class="pull-left"> <em class="fa fa-trash fa-2x fa-fw text-danger"></em> </div>
                                                    <div class="media-box-body clearfix">
                                                        <p class="m0">删除</p>
                                                        <p class="m0 text-muted"> <small>该分享会永久删除</small> </p>
                                                    </div>
                                                </div>
                                                </a> </div>
                                        </li>
                                    </ul>
                                </div>
                                <div class="m0"> <a href="javascript:void(0);" class="text-muted" th:text="${collect.userName}" th:onclick="'locationUrl(\'/user/' + ${collect.userId} + '/0\',\'\');'" >user name</a> <a th:if="${myself=='YES'}" th:id="'private' + ${collect.id}"   class="deco-none"  title="设为私密"  href="javascript:void(0);"  th:style="'display:' + @{(${collect.type}=='PRIVATE' ? 'none' : 'inline-block')} + ''"  th:onclick="'changePrivacy(' + ${collect.id} + ',\'PRIVATE\');'"> <span class="fa fa-lock" style="color: #eee;"></span> </a> <a th:if="${userId == collect.userId}" th:id="'public' + ${collect.id}"  class="deco-none"  title="设为公开"  href="javascript:void(0);"  th:style="'display:' + @{(${collect.type}=='PUBLIC' ? 'none' : 'inline-block')} + ''"  th:onclick="'changePrivacy(' + ${collect.id} + ',\'PUBLIC\');'"> <span class="fa fa-lock text-warning"></span> </a> <small class="ml-sm text-muted" th:text="${collect.collectTime}">6天前 </small> </div>
                            </div>
                        </div>
                        <div class="m0" th:text="${collect.remark}"></div>
                        <div class="media resource-card-thumbnail"> <a  th:onclick="'saveLookRecord(' + ${collect.id} + ');'" th:href="@{${collect.url}}" class="pull-left" target="_blank">
                            <div class="media-object resource-card-image"  th:style="'background-image:url(' + @{(${collect.logoUrl}=='' ? '/img/favicon.png' : ${collect.logoUrl})} + ')'" ></div>
                            </a>
                            <div class="media-body">
                                <h4 class="visible-xs media-heading resource-card-title-xs"> <a target="_blank" th:onclick="'saveLookRecord(' + ${collect.id} + ');'" th:href="@{${collect.url}}" th:text="${collect.title}">title</a> </h4>
                                <h3 class="hidden-xs media-heading resource-card-title"> <a target="_blank" th:onclick="'saveLookRecord(' + ${collect.id} + ');'" th:href="@{${collect.url}}" th:text="${collect.title}">title</a> </h3>
                                <div class="hidden-xs resource-card-content">
                                    <p  th:text="${collect.description}">description</p>
                                </div>
                            </div>
                        </div>
                        <div class="m0"> <span class="icon-folder mr-sm"></span> <a href="javascript:void(0);" class="normal-color-a ng-binding"   th:text="${collect.favoriteName}" th:onclick="'locationUrl(\'/standard/' + ${collect.favoritesId} + '/'+${user.id}+'\',\''+ ${collect.favoritesId} + '\');'" >文件加名称</a>
                            <div th:if="${loginUser!=null}" class="pull-right hidden-xxs">
                                <a th:id="'like' + ${collect.id}"  class="sharing-action-button" th:style="'display:' + @{(${collect.Praise} ? 'none' : 'inline-block')} + ''"    th:onclick="'changeLike(' + ${collect.id} + ');'"> <span class="fa fa-thumbs-o-up"></span>
                                <show th:id="'likeS' + ${collect.id}"  th:text="|点赞(${collect.praiseCount})|" ></show>
                                </a> 
                                <!-- <if th:id="'unlikel' + ${collect.id}"  th:style="'display:' + @{(${collect.Praise} ? 'inline-block' : 'none')}+ ''" > | </if> --> 
                                <a th:id="'unlike' + ${collect.id}"  class="sharing-action-button" th:style="'display:' + @{(${collect.Praise} ? 'inline-block' : 'none')}+ ''"    th:onclick="'changeLike(' + ${collect.id} + ');'"> <span class="fa fa-thumbs-up"></span>
                                <show th:id="'unlikeS' + ${collect.id}" th:text="|取消点赞(${collect.praiseCount})|"></show>
                                </a>
                                <input th:id="'praiseC' + ${collect.id}" type="hidden" name="praiseC" th:value="${collect.praiseCount}" />
                                <input th:id="'commentC' + ${collect.id}" type="hidden" name="commentC" th:value="${collect.commentCount}" />
                                | <a  class="sharing-action-button btn-comment" href="javascript:void(0);" th:onclick="'switchComment(' + ${collect.id} + ');'" > <span class="fa fa-comment-o"></span>
                                <show th:id="'commentS' + ${collect.id}" th:text="|评论(${collect.commentCount})|"> 评论(0)</show>
                                </a>
                                <if th:if="${myself== 'NO'}" > | </if>
                                <a class="sharing-action-button"  th:if="${myself== 'NO'}" th:onclick="'getCollect(' + ${collect.id} + ',\'usercontent\');'"> <span class="fa fa-spoon"></span> 收藏 </a> </div>
                                <div th:if="${loginUser==null}" class="pull-right hidden-xxs">
                                    <small>
                                        <a class="sharing-action-button" >
                                            <span class="fa fa-thumbs-o-up"></span>
                                            <show th:id="'likeS' + ${collect.id}"  th:text="|点赞(${collect.praiseCount})|" ></show>
                                        </a>
                                        <input th:id="'praiseC' + ${collect.id}" type="hidden" name="praiseC" th:value="${collect.praiseCount}" />
                                        <input th:id="'commentC' + ${collect.id}" type="hidden" name="commentC" th:value="${collect.commentCount}" />
                                        |
                                        <a  class="sharing-action-button btn-comment" href="javascript:void(0);" th:onclick="'switchComment(' + ${collect.id} + ');'">
                                            <span class="fa fa-comment-o"></span>
                                            <show th:id="'commentS' + ${collect.id}" th:text="|评论(${collect.commentCount})|">	 评论(0)</show>
                                        </a>
                                    </small>
                                </div>
                        </div>
                        <div class="collapse" th:id="'collapse' + ${collect.id}">
                            <comments th:id="'commentList' + ${collect.id}"></comments>
                            <div class="media p0" th:id="'comment' + ${collect.id}">
                                <div class="media-body">
                                    <form>
                                        <div th:if="${loginUser!=null}" class="input-group">
                                            <input th:id="'commentContent' + ${collect.id}"   type="text" placeholder="输入评论..." class="form-control"/>
                                            <span class="input-group-btn">
                                            <button class="btn btn-default" type="button" th:onclick="'comment(' + ${collect.id} + ');'" >发送</button>
                                            </span> </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </li>
    </ul>
    <!-- <button id="loadStandardNoMore" class="mt-lg btn btn-warning btn-block" style="display:none" >没有更多了</button> --> 
    <!-- <button th:if="${collects.size() == 15}" id="loadStandardMore" class="mt-lg btn btn-primary btn-block" th:onclick="'loadStandardMore();'">加载更多</button> -->
    <button  id="loadStandardMore" class="mt-lg btn btn-primary btn-block" style="display:none;">加载更多</button>
    <div id="loadingStandard" class="loading-more"><img src="/img/loading.gif" width="64" height="64" /></div>
    <br />
    <br />
    <br />
</div>
<div class="col-lg-9 col-md-9 mt" id="simple"  style="display:none;">
    <!--<div class="btn-group btn-xs mb pull-right" th:if="${collects.size() > 0}" style="margin-top: -25px;"> <a class="btn btn-xs btn-default" id="simpleBtn"> <span class="icon-layers"></span> </a> <a class="btn btn-xs btn-default active" > <span class="icon-list"></span> </a> </div>-->
    <table class="table">
        <tbody id="collectSimpleList">
            <tr th:each="collect,collectStat : ${collects}">
                <td><a target="_blank" style="font-size:16px;color:#656565;" th:onclick="'saveLookRecord(' + ${collect.id} + ');'" th:href="@{${collect.url}}" th:text="${collect.title}">Bootstrap中文网</a></td>
                <td width="10%" class="text-center"><img   th:src="@{(${collect.logoUrl}=='' ? '/img/favicon.png' : ${collect.logoUrl})}"  width="35px" height="25px" alt=""/></td>
                <td width="15%" class="text-center"><div> <a th:if="${myself=='YES'}" href="javascript:void(0);" class="mr" th:onclick="'getCollect(' + ${collect.id} + ',\'usercontent\');'" > <i class="fa fa-pencil"></i> </a> <a th:if="${myself=='YES'}" href="javascript:void(0);" class="ml" th:onclick="'onCollect(' + ${collect.id} + ',\'usercontent\');'"> <i class="fa fa-trash text-danger"></i> </a> </div></td>
            </tr>
        </tbody>
    </table>
    <!-- <button id="loadSimpleNoMore" class="mt-lg btn btn-warning btn-block" style="display:none" >没有更多了</button> --> 
    <!-- <button th:if="${collects.size() == 15}" id="loadSimpleMore" class="mt-lg btn btn-primary btn-block" th:onclick="'loadSimpleMore();'">加载更多</button> -->
    <button  id="loadSimpleMore" class="mt-lg btn btn-primary btn-block" style="display:none;">加载更多</button>
    <div id="loadingSimple" class="loading-more"><img src="/img/loading.gif" width="64" height="64" /></div>
    <br />
    <br />
    <br />
    <input type="hidden" name="forward" id="forward" th:value="'/usercontent/'+${user.id}+'/0'" />
    <input type="hidden" id="userId" th:value="${user.id}"/>
    <input type="hidden" th:if="${myself=='YES'}" name="pageType" id="pageType" value="myself" />
    <input type="hidden" th:if="${myself=='NO'}" name="pageType" id="pageType" value="otherpublic" />
    <input type="hidden" id="userContent" value="usercontent"/>
    <input type="hidden" id="userFavoritesId" th:value="${favoritesId}"/>
    <input type="hidden" th:if="${loginUser!=null}" id="loginUser" th:value="${loginUser.id}"/>
</div>
</body>
<script type='text/javascript' th:inline="javascript">
	$(function(){
		page = 1;

		if("standard" == standardStr){
			$("#standard").show();
			$("#simple").hide();
			$("#showModel").val("standard");
		}else{
			$("#standard").hide();
			$("#simple").show();
			$("#showModel").val("simple");
		}

		$("#standardBtn").click(function(){
			$("#standard").hide();
			$("#simple").show();
			$("#showModel").val("simple");
			standardStr = "simple";
			page = 1;
		});

		$("#simpleBtn").click(function(){
			$("#standard").show();
			$("#simple").hide();
			$("#showModel").val("standard");
			standardStr = "standard";
			page = 1;
		});
	});
</script>
</html>